package com.shenmazong.serveruserapi.util;


public class GoodNumber {
    public static boolean isGoodNum(Integer num) {
        String str = num + "";
        char[] nums = str.toCharArray();

        //-- 111 222
        if(nums[0] == nums[1] && nums[1] == nums[2]
                && nums[3] == nums[4] && nums[4] == nums[5]) {
            return true;
        }

        //-- 12 12 12
        Integer inum = num % 100;
        Integer inums = inum + inum*100 + inum*10000;
        if(inums.equals(num)) {
            return true;
        }

        //--567 567
        inum = num % 1000;
        inums = inum + inum*1000;
        if(inums.equals(num)) {
            return true;
        }

        return false;
    }

    public static void main(String[] args) {

        System.out.println("888888"+isGoodNum(888888));
        System.out.println("111222"+isGoodNum(111222));
        System.out.println("555999"+isGoodNum(555999));
        System.out.println("232323"+isGoodNum(232323));
        System.out.println("191919"+isGoodNum(191919));
        System.out.println("123123"+isGoodNum(123123));
        System.out.println("569569"+isGoodNum(569569));
    }
}
